package com.atguigu2.two;

/**
 * @author lhl
 * @date 2025/3/27 11:50
 */
public class TwoArrayTest1 {
    public static void main(String[] args) {
        //5。数组元素的默认初始化值
        //以动态初始化方式一说明
        int[][] arr1 = new int[2][3];
        //外层元素默认值
        System.out.println(arr1[0]); //地址值
        //内层元素默认值
        System.out.println(arr1[0][0]); //0

        boolean[][] arr2 = new boolean[3][4];
        //外层元素默认值
        System.out.println(arr2[0]); //地址值
        //内层元素默认值
        System.out.println(arr2[0][0]); //false

        String[][] arr3 = new String[3][4];
        //外层元素默认值
        System.out.println(arr3[0]); //地址值
        //内层元素默认值
        System.out.println(arr3[0][0]); //null


        //以动态初始化方式二说明
        int[][] arr4 = new int[2][];
        //外层元素默认值
        System.out.println(arr4[0]); //null
        //内层元素默认值
        System.out.println(arr4[0][0]); //Cannot load from int array because "arr4[0]" is null

        //6、数组的内存解析


    }
}
